{temp('admin/head')}
	
</head>
<body class="page-body">

		{temp('admin/left')}

			{temp('admin/top')}
			
			<!-- Basic Setup -->
			<div class="panel panel-default">
				<div class="panel-heading">
					<h3 class="panel-title">{$tit}</h3>
					<div class="panel-options">
						<a href="{$_url}/admin/?act=pinglun{$gnpd}">
							<i class="fa-rotate-right"></i>
							刷新
						</a>
					</div>
				</div>
				<div class="panel-body">
					
					<script type="text/javascript">
					jQuery(document).ready(function($)
					{
						$("#example").dataTable({
							"oLanguage": {
								"sUrl":"{$adstyle}/js/datatables/js/zn.txt"
							},
							aLengthMenu: [
								[10, 25, 50, 100, -1], [10, 25, 50, 100, "All"]
							]
						});
						
					});
					</script>
					
					<table id="example" class="table table-striped table-bordered" cellspacing="0" width="100%">
						<thead>
							<tr>
								<th style="width:10%;">ID</th>
								<th style="width:10%;">课程id</th>
								<th style="width:10%;">用户id</th>
								<th style="width:10%;">类型</th>
								<th style="width:10%;">回复人</th>
								<th style="width:10%;">被回复人</th>
								<th>内容</th>
								<th style="width:20%;">操作</th>
							</tr>
						</thead>
					
						<tbody class="middle-align">
							{if(@$r)}
							{foreach($r as $k=>$v)}
							<tr>
								<td>{$v['id']}</td>
								<td>{$v['zid']}</td>
								<td>{$v['uid']}</td>
								<td>
									{if($v['hdid'] == 0)}
										评论
									{else}
										回复
									{/if}
								</td>
								<td>{$v['hfid']}</td>
								<td>
								{if($v['hdid'] == 0)}
									不是回复
								{else}
									{$v['hdid']}
								{/if}
								</td>
								<td style="padding-top:7px;word-break:break-all;">{$v['content']}</td>
								<td>
									<button onclick="ck({$v['id']},{$v['zid']})" class="btn btn-secondary btn-sm btn-icon icon-left">
										查看
									</button>
									<button onclick="sc({$v['id']},{$v['zid']})" class="btn btn-danger btn-sm btn-icon icon-left">
										删除
									</button>
								</td>
							</tr>
							{/foreach}
							{/if}
						</tbody>
					</table>
					
				</div>
			</div>
			
			<script type="text/javascript">
				function ck(id,zid){
					location.href = '{$_url}/admin/?act=pinglun&met=pinglun_xx&id='+id+'&zid='+zid+'{$gnpd}';
				}
				
				function sc(id,zid){
					$.post('{$_url}/admin/?act=pinglun&met=pinglun_sc{$gnpd}',{id:id,zid:zid},function(data){
						if(data == 'cg'){
							alert('删除成功');
							location.href = '';
						}else if(data == 'error'){
							alert('删除失败');
						}
					});
				}
			</script>
		{temp('admin/foot')}
		
	<!-- Imported styles on this page -->
	<link rel="stylesheet" href="{$adstyle}/js/datatables/dataTables.bootstrap.css">

	<!-- Bottom Scripts -->
	<script src="{$adstyle}/js/ajaxfileupload.js"></script>
	<script src="{$adstyle}/js/bootstrap.min.js"></script>
	<script src="{$adstyle}/js/TweenMax.min.js"></script>
	<script src="{$adstyle}/js/resizeable.js"></script>
	<script src="{$adstyle}/js/joinable.js"></script>
	<script src="{$adstyle}/js/xenon-api.js"></script>
	<script src="{$adstyle}/js/xenon-toggles.js"></script>
	<script src="{$adstyle}/js/datatables/js/jquery.dataTables.min.js"></script>
	<script src="{$adstyle}/js/xenon-custom.js"></script>

	<!-- Imported scripts on this page -->
	<script src="{$adstyle}/js/datatables/dataTables.bootstrap.js"></script>
	<script src="{$adstyle}/js/datatables/yadcf/jquery.dataTables.yadcf.js"></script>
	<script src="{$adstyle}/js/datatables/tabletools/dataTables.tableTools.min.js"></script>

</body>
</html>